package com.runfast.waimai.web.controller;

import com.runfast.common.utils.TokenUtil;
import com.runfast.common.web.entity.Result;
import com.runfast.waimai.dao.model.RunfastAccountrecord;
import com.runfast.waimai.dao.model.RunfastWithdraw;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.*;

import java.awt.print.Pageable;
import java.util.List;

/**
 * 我的钱包接口
 */
@RestController("userWmWalletController")
@RequestMapping(value= "/api/user/wm/wallet", headers = "token")
public class WalletController {

    /**
     * 收支明细列表
     * @param token
     * @return
     */
    @PostMapping("/inOutDetail")
    public Result<List<RunfastAccountrecord>> inOutDetail(@RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }


    /**
     * 提现申请
     * @param amountWithdraw 提现金额
     * @param bankAccountId 银行卡账户
     * @param token
     * @return
     */
    @PostMapping("/withdraw")
    public Result<List<RunfastAccountrecord>> withdraw(@RequestParam int amountWithdraw, @RequestParam int bankAccountId, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }


    /**
     * 提现记录
     * @param pageable
     * @param token
     * @return
     */
    @PostMapping("/withdrawRecord")
    public Result<List<RunfastWithdraw>> withdrawRecord(@PageableDefault Pageable pageable, @RequestHeader String token) {
        Integer userId = TokenUtil.getUserId(token);


        return Result.ok("");
    }



}
